local yaoshi_skill = fk.CreateSkill {

  name = "#yaoshi_skill",
  attached_equip = "yaoshi",

  tags = {  },

}
yaoshi_skill:addEffect(fk.TurnStart, {
  global = true,
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and #player:getCardIds(Player.Judge) > 0 and #player:getCardIds(Player.Equip) > 0
        and table.find(player:getCardIds(Player.Judge), function(cid)
          if Fk:getCardById(cid).trueName == "lightning" then
            event:setCostData(self, cid)
            return true
          end
        end) and table.find(player:getCardIds(Player.Equip), function(cid)
          return Fk:getCardById(cid).name == "yaoshi"
        end)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:broadcastPlaySound(Thbattle_path .. "audio/card/male/yaoshi")
    room:moveCards({
      ids = { event:getCostData(self) },
      from = player,
      to = player.next,
      toArea = Card.PlayerJudge,
      proposer = player,
      moveVisible = true,
      skillName = yaoshi_skill.name,
      moveReason = fk.ReasonJustMove
    })
  end,
})


yaoshi_skill:addEffect("distance", {
  correct_func = function(self, from, to)
    if to:hasSkill(yaoshi_skill.name) then
      return 1
    end
  end,
})

return yaoshi_skill